package com.sc.teacher.controller;

import com.sc.teacher.pojo.Eduteacher;
import com.sc.teacher.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/teacher")
public class TeacherController {
    @Autowired
    TeacherService ts;

    //跳转展示页面
    @RequestMapping("/toShow")
    public String toShow(){
        return "/show";
    }

    //跳转到登陆页面
    @RequestMapping("/tlogin")
    public String tlogin(){
        return "/login";
    }

    //修改教师信息
    @RequestMapping("/updTeacher")
    public String upTeacher(Eduteacher teacher){
        ts.updTeacher(teacher);
        //不论成功与否  直接展示信息
        return "redirect:/teacher/toShow";
    }
}
